import http.cookiejar
from urllib import request



class HtmlDownloader(object):


    def download(self,url):
        if url is None:
            return None

        response = request.urlopen(url)     #下载页面

        if response.getcode() != 200:       #如果下载不成功，返回None
            print('请求的url响应失败：'+url)
            return None

        return response.read()      #返回下载到的内容

